
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>保单查询</title>
    <%@include file="../common.jsp" %>
    <script type="text/javascript">
        $(function () {
            $("#search_panel").panel({
                title:"高级查询面板",
                fit:true
            });

            $("#orderBill_datagrid").datagrid({
                height:350,
                rownumbers:true,
                singleSelect:true,
                pagination:true,
                url:'/orderBill/selectBillAdvanced',
                fitColumns:true,
                columns:[
                    [
                        {field:'ck',checkbox:true},
                        {field:'insureBillNumber',align:'center',width:200,title:'投保单号'},
                        {field:'org_organizationName',align:'center',width:200,title:'承保机构'},
                        {field:'apl_realname',align:'center',width:100,title:'投保人名称'},
                        {field:'carPlateNumber',align:'center',width:180,title:'车牌号码'},
                        {field:'status',align:'center',width:200,title:'保单状态',formatter:statusFormatter},
                        {field:'p_name',align:'center',width:180,title:'产品名称'},
                        {field:'inputTime',align:'center',width:180,title:'申请时间'},
                        {field:'beginDate',align:'center',width:180,title:'保险起期'},
                        {field:'endDate',align:'center',width:180,title:'保险止期'}
                    ]
                ]
            });
            $("a[data-cmd]").on("click",function(){
                //获取表单 高级查询条件, 封装到 qo中, 并且重新加载 datagrid
                var organizationNameD = $("[name=organizationNameD]").val();
                var insureBillNumberD = $("[name=insureBillNumberD]").val();
                var productName = $("[name=productName]").val();
                var carPlateNumberD = $("[name=carPlateNumberD]").val();
                var aplicantName = $("[name=aplicantName]").val();
                var recognizeeNameD = $("[name=recognizeeNameD]").val();

                var inputBeginDateD = $("[name=inputBeginDateD]").val();
                var inputEndDateD = $("[name=inputEndDateD]").val();
                var beginDateD = $("[name=beginDateD]").val();
                var endDateD = $("[name=endDateD]").val();
                var writtenBeginDate = $("[name=writtenBeginDate]").val();

                var writtenEndDate = $("[name=writtenEndDate]").val();
                var engineNumD = $("[name=engineNumD]").val();
                var VIND = $("[name=VIND]").val();
                var employeeNameD = $("[name=employeeNameD]").val();



                $("#orderBill_datagrid").datagrid("load",{
                    organizationNameD:organizationNameD,
                    insureBillNumberD:insureBillNumberD,
                    productName:productName,
                    carPlateNumberD:carPlateNumberD,
                    aplicantName:aplicantName,
                    recognizeeNameD:recognizeeNameD,
                    inputBeginDateD:inputBeginDateD,
                    inputEndDateD:inputEndDateD,
                    beginDateD:beginDateD,
                    endDateD:endDateD,
                    writtenBeginDate:writtenBeginDate,
                    writtenEndDate:writtenEndDate,
                    engineNumD:engineNumD,
                    VIND:VIND,
                    employeeNameD:employeeNameD,

                });
            });
        });
        function statusFormatter(value,record,index){
            if(value==0){
                return "<font color='orange'>未提交</font>";
            }else if(value == 1){
                return "<font color='orange'>待审核</font>";
            }else if(value == 2){
                return "<font color='orange'>提交上级审核</font>";
            }else if(value == 3){
                return "<font color='orange'>待批改</font>";
            }else if(value == 4){
                return "<font color='orange'>待缴费</font>";
            }else if(value == 5){
                return "<font color='green'>已缴费</font>";
            }else if(value == 6){
                return "<font color='red'>已作废</font>";
            }else if(value == 7){
                return "<font color='orange'>批改待审核</font>";
            }
        }
    </script>
</head>
<body>
<div id="search_panel" >
        <form id="search_form" method="post">
            <table style="width: 100%">
                <tr>
                    <td><select name="organizationNameD" class="easyui-combobox"
                         data-options="label:'机构部门:',labelPosition:'before',prompt:'请选择机构部门', width:450,
                         valueField:'id',textField:'organizationName',url:'/organization/selectList'"/></td>
                    <td><input name="insureBillNumberD" class="easyui-textbox" data-options="label:'投保单号:',labelPosition:'before',prompt:'请输入保单号', width:250"></td>
                </tr>
                <tr>
                    <td><select name="productName" class="easyui-combobox"
                               data-options="label:'产品:',labelPosition:'before',prompt:'请选择产品名称', width:450,
                               valueField:'id',textField:'name',url:'/product/selectList'"/></td>
                    <td><input name="carPlateNumberD" class="easyui-textbox" data-options="label:'车牌号码:',labelPosition:'before',prompt:'请输入保单号', width:250"></td>
                </tr>
                <tr>
                    <td><input name="aplicantName" class="easyui-textbox" data-options="label:'投保人:',labelPosition:'before',prompt:'投保人名称', width:450"></td>
                    <td><input name="recognizeeNameD" class="easyui-textbox" data-options="label:'被保人:',labelPosition:'before',prompt:'被保人名称', width:250"></td>
                </tr>
                <tr>
                    <td>
                    <input name="inputBeginDateD" class="easyui-datebox" data-options="label:'投保申请日期:',labelPosition:'before',width:250,labelWidth:130"/>
                    ~<input name="inputEndDateD" class="easyui-datebox" data-options="width:180"/></td>
                </tr>
                <tr>
                    <td>
                    <input name="beginDateD" class="easyui-datebox" data-options="label:'保险起期:',labelPosition:'before',width:250"/>
                    ~<input name="endDateD" class="easyui-datebox" data-options="width:180"/></td>
                </tr>
                <tr>
                    <td>
                    <input name="writtenBeginDate" class="easyui-datebox" data-options="label:'保险起期:',labelPosition:'before',width:250"/>
                    ~<input name="writtenEndDate" class="easyui-datebox" data-options="width:180"/></td>
                </tr>
                <tr>
                    <td><input name="engineNumD" class="easyui-textbox" data-options="label:'发动机号:',labelPosition:'before',prompt:'投保人名称', width:450"></td>
                    <td><input name="VIND" class="easyui-textbox" data-options="label:'车架号:',labelPosition:'before',prompt:'被保人名称', width:250"></td>
                </tr>
                <tr>
                    <td><input name="employeeNameD" class="easyui-textbox" data-options="label:'业务员:',labelPosition:'before',prompt:'投保人名称', width:450"></td>
                </tr>
            </table>
            <div>
                <a class="easyui-linkbutton" data-options="width:100" iconCls="icon-search" data-cmd="search">查询</a>
            </div>
        </form>

    <div id="orderBill_datagrid"></div>
</div>
</body>
</html>
